import Vue from 'vue'
import Router from 'vue-router'
import Layout from '@/views/Layout'
import Main from '@/views/Dashboard'
import Menu from '@/views/system/Menu'
import User from '@/views/system/User'

Vue.use(Router)

export default new Router({
  routes: [{
      path: '/',
      name: 'home',
      component: Layout,
      children: [{
        path: '/main',
        name: 'main',
        component: Main
      }, {
        path: '/menu',
        name: 'menu',
        component: Menu
      }, {
        path: '/user',
        name: 'user',
        component: User
      }, {
        path: '/profile',
        name: 'profile',
        component: () => import ( /* webpackChunkName: "profile" */ '@/views/system/Profile')
      }]
    },
    {
      path: '/404',
      name: '404',
      component: () => import ( /* webpackChunkName: "404" */ '@/views/NotFound.vue')
    },
    {
      path: '*',
      redirect: '/404'
    }

  ]
})